package com.evil.kingdom.controller.alive;

import com.evil.common.core.entity.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

/**
 * socket
 *
 * @author liyang
 * @date 2024-06-01 12:30
 */
@Slf4j
@Controller
public class WebSocketController {

    @MessageMapping("/hello")
    @SendTo("/topic/greetings")
    public R<?> greeting(Object message) throws Exception {
        return R.success(message);
    }
}
